<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>wangEditor</title>
    <script src="/js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="https://unpkg.com/wangeditor/release/wangEditor.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>

<div id="div3"></div>
<button id="btnSubmit">提交</button>

<script>
    var E = window.wangEditor
    var editor = new E('#div3')
    editor.customConfig.uploadImgServer = '上传图片服务器'
    editor.create()

    function getContent() {
        var e_html = editor.txt.html(); //获取html
        var e_text = editor.txt.text(); //获取text
        //$('#content_html').text(e_html);
        //$('#content_text').text(e_text);
        console.log("html="+e_html);
        console.log("e_text="+e_text);
    }

    $("#btnSubmit").click(function () {
        getContent();
    });
</script>
</body>
</html>